<?php
namespace Models;
class CommonModel {
    protected $db;
    public function __construct()
    {
        try {
            $dsn = 'mysql:host=localhost;dbname=bbs;charset=utf8';
            $this->db = new \PDO($dsn, 'root', '654321');
            $this->db->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE,
                \PDO::FETCH_ASSOC);
        }catch (\PDOException $e) {
            exit($e->getMessage());
        }
    }
}